Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.get = function(o, t, n) {
    return e("GET", o, t, n);
}, exports.post = function(t, n) {
    var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {
        "Content-Type": "application/json"
    }, l = wx.getStorageSync(o.getAuthTokenKey());
    null != l && null != l || (l = "");
    console.log(l), (null == r || null == r) && (r = {});
    return r["Auth-Token"] = l, r.App = wx.getStorageSync("App"), e("POST", t, n, r);
}, exports.request = e, exports.rootUrlTest = exports.rootUrlProduce = void 0;

var o = require("./util.js");

exports.rootUrlProduce = "http://jsonplaceholder.typicode.com";

function e(e, t, n) {
    var r, l, c = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {
        "Content-Type": "application/json"
    }, s = wx.getStorageSync(o.getAuthTokenKey());
    return null != s && null != s || (s = ""), console.log(s), null != c && null != c || (c = {}), 
    c["Auth-Token"] = s, c.App = wx.getStorageSync("App"), new Promise(function(o, s) {
        wx.request({
            url: t,
            method: e,
            header: c,
            data: n || {},
            success: function(e) {
                r = e.data, o(e.data);
            },
            fail: function(o) {
                l = o, s(o);
            },
            complete: function() {
                console.info("==============>请求开始<=============="), console.warn(e, t), n && console.warn("参数：", n), 
                r ? console.warn("返回成功：", r) : console.warn("返回失败：", l), console.info("==============>请求结束<==============");
            }
        });
    });
}

exports.rootUrlTest = "http://jsonplaceholder.typicode.com";